/**
 * There are code generation
 */
package com.neusoft.lohas.modules.ivm.entity.merchant;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.neusoft.lohas.common.persistence.IdEntity;

/**
 * 配送费Entity
 * @author Jackie.Liu
 * @version 2015-04-16
 */
@Entity
@Table(name = "ivm_delivery_fee")
@DynamicInsert @DynamicUpdate
public class DeliveryFee extends IdEntity<DeliveryFee> {

	private static final long serialVersionUID = 1L;
	private Merchant merchant; //商户信息
	private String openState;	//是否开启：1是，0否
	private double lowFee; 		//起送费
	private double amount; //配送费
	private Date beginDate; //有效起日
	private Date endDate; //有效止日
	
	public DeliveryFee() {
		super();
	}

	public DeliveryFee(String id){
		this();
		this.id = id;
	}
	
	@ManyToOne
	@JoinColumn(name="merchant_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@JsonIgnore
	@NotNull(message="所属商户信息不能为空")
	public Merchant getMerchant() {
		return merchant;
	}

	public void setMerchant(Merchant merchant) {
		this.merchant = merchant;
	}
	
	public String getOpenState() {
		return openState;
	}

	public void setOpenState(String openState) {
		this.openState = openState;
	}

	public double getLowFee() {
		return lowFee;
	}

	public void setLowFee(double lowFee) {
		this.lowFee = lowFee;
	}

	public double getAmount() {
		return amount;
	}

	public void setAmount(double amount) {
		this.amount = amount;
	}

	public Date getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

}


